package com.linjiahao.userservice.controller;


import com.linjiahao.commonutils.ResultMap;
import com.linjiahao.userservice.entity.FriendsAsk;
import com.linjiahao.userservice.service.FriendsAskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-10-26
 */
@RestController
@RequestMapping("/userservice/friends-ask")
public class FriendsAskController {

    @Autowired
    FriendsAskService friendsAskService;

    @PostMapping("addFriend_ask")
    public ResultMap addFriendAsk(@RequestBody FriendsAsk friendsAsk){
        boolean save = friendsAskService.save(friendsAsk);
        if(save){
            return ResultMap.ok();
        }else {
            return ResultMap.error();
        }

    }

}

